type t = [ `toto of int * int | `titi of int -> int ];;

let f (x : t) =
  match x with
    | `toto (x, y) -> (x-1, y+1)
    | `titi f -> (42, f 42)
in
let (x, y) = f (`titi (fun x -> (snd (f (`toto (1, x)))))) in
  print_int x;
  print_char ' ';
  print_int y;
  print_newline ();
;;

match `hello "world" with
  | `bye -> print_endline "problem"
  | `hello s -> print_endline s
  | `none _ -> print_endline "another problem"
;;
